<template>
  <div class="unit">
    <div>
      <van-checkbox-group v-model="result">
        <van-cell-group>
          <van-cell
            v-for="(item, index) in list"
            clickable
            :key="item"
            :title="`${item}`"
            @click="toggle(index)"
          >
            <van-checkbox :name="item" ref="checkboxes" />
          </van-cell>
        </van-cell-group>
      </van-checkbox-group>
    </div>
  </div>
</template>

<script>
    export default {
      name: "Unit",
      data(){
        return{
          list:['内容1','内容2','内容3','内容4','内容5']
        }
      },
      methods:{
        toggle(index) {
          this.$refs.checkboxes[index].toggle();
        }
      }
    }
</script>

<style scoped>

</style>
